package com.yami.shop.platform.task;

import com.xxl.job.core.handler.annotation.XxlJob;
import com.yami.shop.nftaccount.common.service.NftAssetSettleService;
import com.yami.shop.nftaccount.common.service.NftAssetTrendsService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@AllArgsConstructor
public class NftAssetTask {
    
    private final NftAssetTrendsService assetTrendsService;
    
    private final NftAssetSettleService assetSettleService;

    /**
     * nft资产交易对账
     * 0 0 1 * * ?
     */
    @XxlJob("nftAssetReconciliation")
    public void nftAssetReconciliation() {
        assetTrendsService.checkTrends();
    }



    /**
     * nft资产进入待结算
     * 0 0 4,11,23 * * ?
     */
    @XxlJob("nftAssetTobeSettled")
    public void nftAssetTobeSettled() {
        assetSettleService.toBeSettled();
    }



    /**
     * nft资产结算
     * 0 0 5 * * ?
     */
    @XxlJob("nftAssetSettlement")
    public void nftAssetSettlement() {
        assetSettleService.delivery();
    }


    /**
     * 链上资产交割结果
     * 0 0 0/1 * * ?
     */
    @XxlJob("nftAssetVerifyResult")
    public void nftAssetVerifyResult() {
        assetSettleService.verifyTransferResults();
    }


}
